package com.nuonuo.nuo_xp;

import android.util.Log;
import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.callbacks.XC_LoadPackage;

/**
 * @author glsite.com
 * @version $Rev$
 * @des ${TODO}
 * @updateAuthor $Author$
 * @updateDes ${TODO}
 */
//屏蔽代理检测
public class HOOK_Proxy_detection implements IXposedHookLoadPackage {
    //不要随机注入  否则可能导致抓不到包
    public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam loadPackageParam) {
        Log.d("XP", "HOOK_Proxy_detection by nuonuo ......");
        XposedHelpers.findAndHookMethod(System.class, "getProperty", new Object[]{String.class, new XC_MethodHook() {
            /* access modifiers changed from: protected */
            public void afterHookedMethod(XC_MethodHook.MethodHookParam param) throws Throwable {
                Log.d("XP", "Hooking getProperty from: " + loadPackageParam.packageName);
                String str = (String) param.args[0];
                if (str.equals("https.proxyHost") || str.equals("http.proxyHost") || str.equals("http.proxyPort") || str.equals("https.proxyPort")) {
                    param.setResult((Object) null);
                }
            }
        }});
    }
}